UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7yFE2BCEdjP4mU+vAQsAqfscsTIz+TzE/A8p1oJcIqc='
WHERE
key_id = 'afba4bc0cb91a7645d9b1a03f27b75ad569d2e006904cb62a486dfc62e8487a4'
AND (
token = '7yFE2BCEdjP4mU+vAQsAqfscsTIz+TzE/A8p1oJcIqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)