UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/xEbZ8YoZukEBymUsBLF1pltBgE8r5USNSDJhR3c7OU=' 
WHERE 
  key_id = 'e9fb8278c97416547e8eedc2f3ae8c1fb7418453969202b730882c87d1181d21' 
  AND (
    token = '/xEbZ8YoZukEBymUsBLF1pltBgE8r5USNSDJhR3c7OU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039