UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KDyb+zPmcnOzTwlZLoSofK5Ih8rjFHMiYMXBd595pAw=' 
WHERE 
  key_id = 'ce9d2f2e6e78ab053277fc1bccc98d0b774170d58a4cd7e28af132ad03f0c6b1' 
  AND (
    token = 'KDyb+zPmcnOzTwlZLoSofK5Ih8rjFHMiYMXBd595pAw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057