UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V0Yy9yQ2jEwMoNTPCOd0P8vutywm3KOUkfsUhhQMk1k='
WHERE
key_id = '3236864c6db8d959625e7f699cf6d278f5970a3856638556d7064e3af1d47864'
AND (
token = 'V0Yy9yQ2jEwMoNTPCOd0P8vutywm3KOUkfsUhhQMk1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)