UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jKjBhDvED/sNNybGRqhIT+o8K+Aa67ihJb4z5yc1Yp4=' 
WHERE 
  key_id = 'd8145b6a8fe48f25b3ed0956ed2075386b01fcffc51518c26a54ecedcd09fa38' 
  AND (
    token = 'jKjBhDvED/sNNybGRqhIT+o8K+Aa67ihJb4z5yc1Yp4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015