UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xNt8Pwe0zkYELOUhyR1OqSm8Mve6Lrrjzf3X6+8LJX0=' 
WHERE 
  key_id = '6cc3806878dfc236c854fdcaf7d7a3652db7490481a5b53df7ac9e7b1c8a91fd' 
  AND (
    token = 'xNt8Pwe0zkYELOUhyR1OqSm8Mve6Lrrjzf3X6+8LJX0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049