UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a4raUUXww1QSc2ozXun4OJ2EWc3iVROZX8SBhcnSf3A='
WHERE
key_id = '15a860a3fd73b298a61025d0ace785a3c32ecf29a63e8d6322c58568735ba5b8'
AND (
token = 'a4raUUXww1QSc2ozXun4OJ2EWc3iVROZX8SBhcnSf3A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)