UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wi1YVsxkEn4HWYJ58uGV1KQFMQ+lIUXGMx4CASdivuo='
WHERE
key_id = '91e8ac356b965492ec9a365db983d8b6a36a50ffb1f4aa82998240d00e13a46a'
AND (
token = 'Wi1YVsxkEn4HWYJ58uGV1KQFMQ+lIUXGMx4CASdivuo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)