UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QVkq4/oijArXoESKlq3sUn2KSjB3+iWD0x49LjG2mFI=' 
WHERE 
  key_id = '01e7dc6ac3f69b717baf66ee1020c9832f155d1228a81f0a4186b3cb510c2018' 
  AND (
    token = 'QVkq4/oijArXoESKlq3sUn2KSjB3+iWD0x49LjG2mFI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028