UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kXaiiN8+SV1/lCEeC8hVmOh2skEXsrfk+XKUwUGeBy4='
WHERE
key_id = '79eb89dfe0315308a091527af61e44db11fc1de5c6d545dcad31cda99466fd79'
AND (
token = 'kXaiiN8+SV1/lCEeC8hVmOh2skEXsrfk+XKUwUGeBy4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)