UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fH1knRALaWbTicMWghfs8/anL3aSSimrEVkLTpvXpns='
WHERE
key_id = '83c4a457fec6fe11dd2fe380d2305500ad6fe717d71dc4ee7764f6a23e97bad8'
AND (
token = 'fH1knRALaWbTicMWghfs8/anL3aSSimrEVkLTpvXpns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)