UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SuWNRG2Wsz21uWIxCRddIzsKxUGd0FZhD44kL/a/7r4=' 
WHERE 
  key_id = '97f5b3481de16ae35d0b4cb20b1ccde3276c4592450bad779a7a7e00bb585169' 
  AND (
    token = 'SuWNRG2Wsz21uWIxCRddIzsKxUGd0FZhD44kL/a/7r4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017