UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sTa3H03AGJ+7IUTqOIR5gvLzRgSyCDYpH/foVJv0qJA='
WHERE
key_id = '17d56500485ca5ee0efdfc06633c87f93bdd67827c69b14dfa5794c7834cbc14'
AND (
token = 'sTa3H03AGJ+7IUTqOIR5gvLzRgSyCDYpH/foVJv0qJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)