UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8VUVTJJMio8I7Xy7UZVM0Lb7Qk6ScuB38GkZM77/nrA=' 
WHERE 
  key_id = '1767cd98e1ce3749cc47008c7e799a4db8ab07f44ba514e8d95eeec2a7e5292d' 
  AND (
    token = '8VUVTJJMio8I7Xy7UZVM0Lb7Qk6ScuB38GkZM77/nrA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048