UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8rjreY7KbL8MMXvBW4u+Wbp2tABjeC372FLfTmmS5Ac=' 
WHERE 
  key_id = '741bb8c987b46cb275dad99cc58bde4faf0c1161cdb378fcb2c4a07ae73b370e' 
  AND (
    token = '8rjreY7KbL8MMXvBW4u+Wbp2tABjeC372FLfTmmS5Ac=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022