UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KbNCnvYz0TbhGCGtZso2s6DS82vTsVcJR0HLpa0jLv0='
WHERE
key_id = '32b98b492c1bd7e96d0c9ff1354bd6a4a1b7bc0f8a1644545f64696939c28be5'
AND (
token = 'KbNCnvYz0TbhGCGtZso2s6DS82vTsVcJR0HLpa0jLv0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)