UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ouMk5GbSWrNZzZ8ZkKn/L+kiMntpO/iZ8hLegh8GkoI=' 
WHERE 
  key_id = '6af2fa87985945ab7b4f8c83a6694a690f81581258a9685b757b684a9988ab0f' 
  AND (
    token = 'ouMk5GbSWrNZzZ8ZkKn/L+kiMntpO/iZ8hLegh8GkoI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025