UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E5tuVFnAjE/Nj81X8/56weFomDlaa1d2t5F4koYhX4w='
WHERE
key_id = '04f96c0d73705cb93106e3056c0e17e8e423fd330d90494ba1791dbb9253024d'
AND (
token = 'E5tuVFnAjE/Nj81X8/56weFomDlaa1d2t5F4koYhX4w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)