UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QRyFLiwLGcupE96WvMg1Y6JJRXvvV65Zg0Di5H1aBlM=' 
WHERE 
  key_id = '39a8cd89727e9bf8c61d09e3a639134ad3aa5159c2a532a7a56328cb2ea20e5b' 
  AND (
    token = 'QRyFLiwLGcupE96WvMg1Y6JJRXvvV65Zg0Di5H1aBlM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029