UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oPYQzMT00MF1FbEPP0rsdNfpbLIqUi+OXg821Jm4KA4='
WHERE
key_id = '4c3522184bfa58d073eca2b8f3ef363a54da4a8964542e4e2ba3f35d7608af38'
AND (
token = 'oPYQzMT00MF1FbEPP0rsdNfpbLIqUi+OXg821Jm4KA4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)