UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hh4oi9T7+4MuR7i37N7rzKqE4tngUrCFv/5Q26OGARM=' 
WHERE 
  key_id = 'b61a86a32d4ef1321f2ac4441a12294f0c494894bdfd3a0e441e08f2dd43894e' 
  AND (
    token = 'hh4oi9T7+4MuR7i37N7rzKqE4tngUrCFv/5Q26OGARM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029