UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O44/0aTsrxc93YhXMzkVZROyJ0oSfKgXVPJIo13iSgE=' 
WHERE 
  key_id = '4cb9a9e4ae8df81080703d23a8508eade12f377e5910107f80437797fa8478bd' 
  AND (
    token = 'O44/0aTsrxc93YhXMzkVZROyJ0oSfKgXVPJIo13iSgE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018