UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HTrWOnSGkPfXqK6AgFyH3behl1MRKcKPO1D9nGCFnvk=' 
WHERE 
  key_id = '99719666399c7788cfecec211e7c6681bd66369592ac8709784dc2334982c9bc' 
  AND (
    token = 'HTrWOnSGkPfXqK6AgFyH3behl1MRKcKPO1D9nGCFnvk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051