UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oDbPhPjeV876yPa6Rp3DBJt9yvjkDeIxyMcZ+zI5qcA=' 
WHERE 
  key_id = 'b44ce9b8b9be38e21b1179cd78ef20fa8c2b7def385047acf648bd23706cf941' 
  AND (
    token = 'oDbPhPjeV876yPa6Rp3DBJt9yvjkDeIxyMcZ+zI5qcA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036