UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rpvc+R/ScR619KJp2NLaRSIf1Z3Bz2jlS0E56miIVsI='
WHERE
key_id = '76998c735a9f1d28af233139c1a807c3ea1cfd3ba1057af177c7ce632786e827'
AND (
token = 'rpvc+R/ScR619KJp2NLaRSIf1Z3Bz2jlS0E56miIVsI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)