UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9LudctVdOkHmnkbHCn35sK9dGWFoW0+s8tXns/ms2c0='
WHERE
key_id = '59dd09e2807ad0f534a9e3d2c240940e9347b6602d9feb7ce1f4a91dce516ac4'
AND (
token = '9LudctVdOkHmnkbHCn35sK9dGWFoW0+s8tXns/ms2c0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)