UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xkPfjjTK46o7Flq3H+AfRWGdSFc0/mN37fm5FgVNZdA=' 
WHERE 
  key_id = '02bed241815fb21ac9388a21f48fb7bad904ce2905efe9e3dd3ac15351a6d96a' 
  AND (
    token = 'xkPfjjTK46o7Flq3H+AfRWGdSFc0/mN37fm5FgVNZdA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022