UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0LqVDBI+xrR7ZKyhaAGaXeJw8z9LvScuaYHhT1lo6YQ=' 
WHERE 
  key_id = '3b6ccaedcd90052ca4ed41c98c35f7fe72f7b0f1ba20ff67f507b27605bd28f0' 
  AND (
    token = '0LqVDBI+xrR7ZKyhaAGaXeJw8z9LvScuaYHhT1lo6YQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056