UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lUvnqw5orPmxli4mse40k4XEQGBmjHYo5G+Jj02bmnA=' 
WHERE 
  key_id = '63b5f8bbaf6d56f1083c80e9c9be76396a41db8ae724688b3dde9fc1647dfbb3' 
  AND (
    token = 'lUvnqw5orPmxli4mse40k4XEQGBmjHYo5G+Jj02bmnA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024