UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pvnudrtWl4p1HxxhteWRqqhGwlJBa4+nJ/8O5k+zKpQ='
WHERE
key_id = 'f99566d65333b71daf14021c2d4e18e3d8868d36927adf03b7b52f1cb48498e4'
AND (
token = 'pvnudrtWl4p1HxxhteWRqqhGwlJBa4+nJ/8O5k+zKpQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)