UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jue/awyi8+RtXSAZFaPwcqO/B8Zo5Kexa1XK9FS97yw='
WHERE
key_id = 'da3b2368b72d05277d752a431abecd1b602c045618bba3684eed00cf1effe9f3'
AND (
token = 'Jue/awyi8+RtXSAZFaPwcqO/B8Zo5Kexa1XK9FS97yw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)