UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BfJVAX8RMpaiWFFCLiF6bw2eJz2yPtRUhK9K9LA9x4M=' 
WHERE 
  key_id = '693340380fff6f41603309a9b71b9e1206297d3b948175b69bb756bfecf2ed5f' 
  AND (
    token = 'BfJVAX8RMpaiWFFCLiF6bw2eJz2yPtRUhK9K9LA9x4M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047