UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dy8CNJOsg3hLpJmI/fadld6dfiF8KTz1mZV7eNnHEVQ=' 
WHERE 
  key_id = 'c04991281183695d1ca2085bb4982fd0557856e7e6b0f079ac11f153372835c6' 
  AND (
    token = 'dy8CNJOsg3hLpJmI/fadld6dfiF8KTz1mZV7eNnHEVQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025