UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UaZlgrIXF44I0AMGDOpoIs3Swr0QOMCyg7JA98mhmjY=' 
WHERE 
  key_id = '9898b45856f003fd68139fc11190f97ca20da971c3eecc084d002718517ec1d1' 
  AND (
    token = 'UaZlgrIXF44I0AMGDOpoIs3Swr0QOMCyg7JA98mhmjY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017