UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kxrXZZjEkx295N7QdsS1YgJmbIU6LDpU2QjwJfi7S1M=' 
WHERE 
  key_id = 'd6ccb8b0ccaca101556dc073b53d04f68527c5660b39370ce1a1d76a1b5ce09e' 
  AND (
    token = 'kxrXZZjEkx295N7QdsS1YgJmbIU6LDpU2QjwJfi7S1M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021