UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KPFNV7npnCcI9Zrq7XZgui6Xjo2WIzEkHmr8YC7bRmU='
WHERE
key_id = '65a2fa88d806c748d09b5026d4829de6bdb47de1ea5fc273719c83c565eb8051'
AND (
token = 'KPFNV7npnCcI9Zrq7XZgui6Xjo2WIzEkHmr8YC7bRmU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)