UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '805KDQUG8PBnNHXnKK8AOd2PmbzTVRg7k36BUC8UjmA=' 
WHERE 
  key_id = 'ffabbf4ccadf07e650bfb92cf9814f831318eb9959f5fbe024c3043d635c1b53' 
  AND (
    token = '805KDQUG8PBnNHXnKK8AOd2PmbzTVRg7k36BUC8UjmA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058