UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Kj3e1R89f7xtSShZ/zSBNQH1dUThF8IVdNFa6ZNCkgg=' 
WHERE 
  key_id = '478b937cc27ed3106dcda39910dd241a733b60f9d2c6f45f43899441e904487e' 
  AND (
    token = 'Kj3e1R89f7xtSShZ/zSBNQH1dUThF8IVdNFa6ZNCkgg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026