UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5fFgkWWM9cgIYm8ARECTPWK2U6Q1Vpjzkr9Nik0OfKw=' 
WHERE 
  key_id = 'f715081ea4c93eca5b8bd22d27fc1874c5836ef6f577746f8d0b89fed35c7211' 
  AND (
    token = '5fFgkWWM9cgIYm8ARECTPWK2U6Q1Vpjzkr9Nik0OfKw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036