UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8ZR4HsU22Ow3W/ZXQr/2GweRs3N+5NgI7N+RwZeAz5k=' 
WHERE 
  key_id = '23cccec499f2835f37b10644f5725db54255c20daae20ea78682e79fb18fe012' 
  AND (
    token = '8ZR4HsU22Ow3W/ZXQr/2GweRs3N+5NgI7N+RwZeAz5k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039