UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H5Lin1lnKNQo5Eu2O3oGUN+nJKL1ZiHjXlm/9PRcUKg=' 
WHERE 
  key_id = '4f59f47fdc66fa787c726d72d535080cb994e97df1a43cf656f4cff37a5b8cfb' 
  AND (
    token = 'H5Lin1lnKNQo5Eu2O3oGUN+nJKL1ZiHjXlm/9PRcUKg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016