UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sRVSe8L7tH2fcrwOIqUFY5+XqEbPuZXT7Fv72cn+mLU=' 
WHERE 
  key_id = '7a6cfd02fe3c97468d3753969ba2c18f035c5789fc7a887d1e8caa1bc563049b' 
  AND (
    token = 'sRVSe8L7tH2fcrwOIqUFY5+XqEbPuZXT7Fv72cn+mLU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00082