UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EjhHDS3KIoDZ2/3lxYUu2cB8P2fHNTdptbFaeNOYkGA=' 
WHERE 
  key_id = '196144c80f45536cb52b832ba279d6c48db4d082c1cefd0ca7a5e1dec44d502f' 
  AND (
    token = 'EjhHDS3KIoDZ2/3lxYUu2cB8P2fHNTdptbFaeNOYkGA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058