UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9UiC58bHdxXAKInl/Xs1VDkGD1Ecim0F1Bfml5bCa3I=' 
WHERE 
  key_id = '19e95dde24ed17464cb87e3f79386e992fe36689385933edf45a079eca89ad67' 
  AND (
    token = '9UiC58bHdxXAKInl/Xs1VDkGD1Ecim0F1Bfml5bCa3I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023