UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oD4opkqR2QjWsMm5Go7u50O+/HTiHZb2kN5EOwDP1/Q=' 
WHERE 
  key_id = 'e5577b257f2a44ac04253637f3568a16945909b004a23301c8ead82cf06457ba' 
  AND (
    token = 'oD4opkqR2QjWsMm5Go7u50O+/HTiHZb2kN5EOwDP1/Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058