UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+itSiC9yzqrn3PBBntT4ZyuCzebDqdb5UWYBv5vRRHE='
WHERE
key_id = '1d3509fc31d9759000b921d55c282ed2113fac2b869af0f306242ebfeb87f87d'
AND (
token = '+itSiC9yzqrn3PBBntT4ZyuCzebDqdb5UWYBv5vRRHE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)