UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tUD6ZlbB7UwdRCsqzbUmCNM9Ze9NV9ZaVvVjFy/RTv8='
WHERE
key_id = '64e5521fe84fe5bbe9fd0eb583f06261ddb3eed9148b37a733ab71f18af80a67'
AND (
token = 'tUD6ZlbB7UwdRCsqzbUmCNM9Ze9NV9ZaVvVjFy/RTv8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)