UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FB/RPWfiUwaAEEwdKpF31bk1p6EZGvX7NqoL/ZMvCTk=' 
WHERE 
  key_id = '889925e981d03cd52fb5ede7eb646eba138c50fda926e14938163375c4c0393d' 
  AND (
    token = 'FB/RPWfiUwaAEEwdKpF31bk1p6EZGvX7NqoL/ZMvCTk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026