UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Sv7ETSb1Y+d9dlyNg2JUmBu5Nd+bNeDVo8swrU5lzBM=' 
WHERE 
  key_id = 'acaf1e8adf0e6378cb017be3de1365d24b90c592bb80ea4ed57ead2fa4f8a5f2' 
  AND (
    token = 'Sv7ETSb1Y+d9dlyNg2JUmBu5Nd+bNeDVo8swrU5lzBM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018