UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CeCq7qbW4A9QB7GR1vULaZc5I6x8cvp4tetOESDKzvo=' 
WHERE 
  key_id = '3638ea28d2aa23cb62393fbea3fdff68b9bc1fa62ea479ed2ef355431096a526' 
  AND (
    token = 'CeCq7qbW4A9QB7GR1vULaZc5I6x8cvp4tetOESDKzvo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022