UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aEyrJjZSWcObbxfW2qLWj4i4PKHPCBSksPqc7BO8FbM='
WHERE
key_id = '2266954bff18c6ead717d2696a4fb934c9e8fd8e84610689ff3c8dc610306cb6'
AND (
token = 'aEyrJjZSWcObbxfW2qLWj4i4PKHPCBSksPqc7BO8FbM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)