UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1juMxfTAkdaVpnyoHs/pwwuvPRUO4X+0hhideLtb9yY='
WHERE
key_id = '309e5b13f0db01ab609338b2ff263f17e9c195a4100fddd56860bb837b163d79'
AND (
token = '1juMxfTAkdaVpnyoHs/pwwuvPRUO4X+0hhideLtb9yY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)