UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o7HUPrOniZZO2SvYgL4GTHWvduZWPDr8z5MuHBMqIao=' 
WHERE 
  key_id = '760bb273313228c35fdc9c0908c042e442c898223549cffce9ac55a4ad716233' 
  AND (
    token = 'o7HUPrOniZZO2SvYgL4GTHWvduZWPDr8z5MuHBMqIao=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052