UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2Y33wDBLwkHbgaQLRB9LQ0kSMuzwPbpcBsIC/wm4/jA=' 
WHERE 
  key_id = '4fa93e3e2633e51434644bd60a082027da060334c99c05b8a8e79f6d56dc2591' 
  AND (
    token = '2Y33wDBLwkHbgaQLRB9LQ0kSMuzwPbpcBsIC/wm4/jA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015