UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uhEk8N2uM3Emn8Ug3B5dTBo7Nw5GnlQPkxTmiYoCfkQ=' 
WHERE 
  key_id = '32f95831e91dfabc9f1ac3fed6e71fe4b7466ba7627de87f32f779a8ce541df5' 
  AND (
    token = 'uhEk8N2uM3Emn8Ug3B5dTBo7Nw5GnlQPkxTmiYoCfkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033