UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qXPFzMMI72ivCUEdLS13zUSsAaXDEu9N5zoeC9cLODY=' 
WHERE 
  key_id = '668316bb756f441d58db4a5a8fd9c79456a17c6caaca537e5e0ae121e44150a9' 
  AND (
    token = 'qXPFzMMI72ivCUEdLS13zUSsAaXDEu9N5zoeC9cLODY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018