UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9sqXST4cGJQC4y+t1NiAdH7NYUYKa1CRl2qlPtnZm88='
WHERE
key_id = '1ccb5e4d57a05caf50e138ff1f5e17ad90f36314d7370e85b5ea16efe2edd5b6'
AND (
token = '9sqXST4cGJQC4y+t1NiAdH7NYUYKa1CRl2qlPtnZm88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)