UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zu28WOrhUOEhYFy1d+kNj74wjo76WR7nXC1UyGtN+mQ=' 
WHERE 
  key_id = '6f96bf14884325d0a255057ad0d6d7731aa2576a46366286398db96af7c4279d' 
  AND (
    token = 'Zu28WOrhUOEhYFy1d+kNj74wjo76WR7nXC1UyGtN+mQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035