UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X4vI9e7Dbnc386ECkNhHu3yttqyID4p9RT5Dx3t56KI='
WHERE
key_id = '9134f11539cf586741bf289ab964970665d063a0dfeb00baa78ef46623947107'
AND (
token = 'X4vI9e7Dbnc386ECkNhHu3yttqyID4p9RT5Dx3t56KI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)