UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'meNMFY7PEBgzXbEfG8J1CP9xDrr4fe9swut9vr/nyAE=' 
WHERE 
  key_id = '95470af5bbc43124499f28478f25a45417bde3952cd437f94f0465d4dbea5529' 
  AND (
    token = 'meNMFY7PEBgzXbEfG8J1CP9xDrr4fe9swut9vr/nyAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047