UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vGTLiW2gPvMMzA7TV3uj/A+O+kXjFw7hUZEaVEcBHn8='
WHERE
key_id = 'e22570a686b34bd0cddbeb10861804669308282e904e7908c9245064250d2c96'
AND (
token = 'vGTLiW2gPvMMzA7TV3uj/A+O+kXjFw7hUZEaVEcBHn8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)