UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7ZjumqDhUMsMlglB+OzW2kwiAw8fdUVAJeeR94s/mPA=' 
WHERE 
  key_id = '8aa35b61e9fdd34470a52e8c88e4f52ec4f47c33641481f457a0635e3f47d82a' 
  AND (
    token = '7ZjumqDhUMsMlglB+OzW2kwiAw8fdUVAJeeR94s/mPA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036